package com.ruoyi.an.service;

import java.util.List;
import com.ruoyi.an.domain.AnMechanismSettlement;
import com.ruoyi.an.domain.AnMechanismSettlementInfo;
import com.ruoyi.an.domain.AnMechanismSettlementInfoDto;

/**
 * 机构佣金Service接口
 * 
 * @author liuzheng
 * @date 2022-11-12
 */
public interface IAnMechanismSettlementService 
{
    /**
     * 根据订单号查询到匹配的佣金计算规则
     * @param tradeNo
     * @return
     */
    public List<AnMechanismSettlement> selectOutTradeNoSettlementList(String tradeNo);
    /**
     * 查询机构佣金
     * 
     * @param mechanismSettlementId 机构佣金主键
     * @return 机构佣金
     */
    public AnMechanismSettlement selectAnMechanismSettlementByMechanismSettlementId(Long mechanismSettlementId);

    /**
     * 查询机构佣金列表
     * 
     * @param anMechanismSettlement 机构佣金
     * @return 机构佣金集合
     */
    public List<AnMechanismSettlement> selectAnMechanismSettlementList(AnMechanismSettlement anMechanismSettlement);
    /**
     * 查询机构推广佣金明细列表
     *
     * @params  机构Id集合
     */
    public List<AnMechanismSettlementInfoDto> selectAnMechanismSettlementInfoList(List<Long> mechanismIds);
    /**
     * 新增机构佣金
     * 
     * @param anMechanismSettlement 机构佣金
     * @return 结果
     */
    public int insertAnMechanismSettlement(AnMechanismSettlement anMechanismSettlement);

    /**
     * 修改机构佣金
     * 
     * @param anMechanismSettlement 机构佣金
     * @return 结果
     */
    public int updateAnMechanismSettlement(AnMechanismSettlement anMechanismSettlement);

    /**
     * 批量删除机构佣金
     * 
     * @param mechanismSettlementIds 需要删除的机构佣金主键集合
     * @return 结果
     */
    public int deleteAnMechanismSettlementByMechanismSettlementIds(Long[] mechanismSettlementIds);

    /**
     * 删除机构佣金信息
     * 
     * @param mechanismSettlementId 机构佣金主键
     * @return 结果
     */
    public int deleteAnMechanismSettlementByMechanismSettlementId(Long mechanismSettlementId);

    /**
     * 检查新增佣金是否冲突
     * @param anMechanismSettlement
     * @return
     */
    public List<AnMechanismSettlement> checkSettlement(AnMechanismSettlement anMechanismSettlement);

    /**
     * 刷新未挂上机构的用户佣金
     *
     */
    public int syncNullUserMechanismSettlementInfos();


    public int getEffectiveNumberCount(Long mechanismSettlementId);


}
